unit uCxtDAL;

interface

uses
  uDZSysUtils, uDZStr, uDZPersistent, uGxtTypes, uGxtSvcIntf, uCxtTypes, uAsync;

const
  IID_ACCOUNT_DATABASE: TGUID = '{76F0E104-4954-439B-AC97-993636080E8A}';
  IID_VEHICLE_DATABASE: TGUID = '{5F75D05A-77AD-4C22-AD82-B3ADF8763593}';
  
type
  IAccountDatabase = interface(IDzBaseInterface)

  ['{76F0E104-4954-439B-AC97-993636080E8A}']
  
    procedure GetAgencyInfo(CityCode: Integer; Agency: TAgency;
      Param: Pointer; Callback: TSimpleCallback);

    procedure AddAccount(UserInfo: TUserInfo; Param: Pointer; Callback: TSimpleCallback);

    procedure ModifyAccount(UserInfo: TUserInfo; Param: Pointer; Callback: TSimpleCallback);

    procedure ModifyPassword(UserID: Integer; const OldPwd, NewPwd: AnsiString;
      Param: Pointer; Callback: TSimpleCallback);
      
    procedure LockUserByID(UserID: Integer; const ComputerID: AnsiString;
      const Reason: WideString; Param: Pointer; Callback: TSimpleCallback);
      
    procedure GetUserInfo(const ComputerID, UserName: string; UserInfo: TUserInfo;
      Param: Pointer; Callback: TSimpleCallback);
      
    procedure GetUserLocatePoint(UserId: Integer; Param: Pointer; Callback: TSimpleCallback);
      
    procedure DecUserLocatePoint(UserID, Quantity: Integer;
      Param: Pointer; Callback: TSimpleCallback);

    procedure GetUserSmsPoint(UserId: Integer; Param: Pointer; Callback: TSimpleCallback);

    procedure DecUserSmsPoint(UserId, Quantity: Integer;
      Param: Pointer; Callback: TSimpleCallback);
    
    procedure SaveLogin(UserID: Integer; LoginTime: TDateTime; const Source,
      ComputerID: AnsiString; Param: Pointer; Callback: TSimpleCallback);

    procedure  SaveSms(const Sender, Recver, Content: WideString; SendTime: TDateTime;
      Param: Pointer; Callback: TSimpleCallback);

    procedure LockComputer(const ComputerID: AnsiString; const Reason: WideString;
      Param: Pointer; Callback: TSimpleCallback);
      
    procedure UnlockCompter(const ComputerID: AnsiString;
      Param: Pointer; Callback: TSimpleCallback);

    procedure IsComputerLocked(const ComputerID: AnsiString;
      Param: Pointer; Callback: TSimpleCallback);
  end;

  IVehicleDatabase = interface(IDzBaseInterface)

  ['{5F75D05A-77AD-4C22-AD82-B3ADF8763593}']

    procedure GetPriVehicle(UserId, PageSize, PageNo: Integer;
      Filter: TPriVehicleFilter; List: TDzPersistentList;
      Param: Pointer; Callback: TSimpleCallback);

    procedure GetShareVehicle(Filter: TShareVehicleFilter;
      PageNo, PageSize: Integer; List: TDzPersistentList;
      Param: Pointer; Callback: TSimpleCallback);
      
    procedure GetWebShareVehicle(Filter: TWebShareVehicleFilter;
      PageNo, PageSize: Integer; List: TDzPersistentList;
      Param: Pointer; Callback: TSimpleCallback);

    procedure RemovePriVehicle(List: TDzPersistentList;
      Param: Pointer; Callback: TSimpleCallback);

    procedure AddPriVehicle(Vehicle: TVehicle; Param: Pointer;
      Callback: TSimpleCallback);

    procedure ModifyPriVehicle(Vehicle: TVehicle;Param: Pointer;
      Callback: TSimpleCallback);

    procedure RemoveLocPerson(List: TDzPersistentList;
      Param: Pointer; Callback: TSimpleCallback);
    
    procedure AddLocPerson(Person: TLocPerson; Param: Pointer;
      Callback: TSimpleCallback);
    
    procedure ModifyLocPerson(Person: TLocPerson; Param: Pointer;
      Callback: TSimpleCallback);
    
    procedure GetLocPerson(UserID, PageNo, PageSize: Integer;
      Filter: TLocPersonFilter; List: TDzPersistentList;
      Param: Pointer; Callback: TSimpleCallback);
      
    procedure SaveLocateResult(const Phone, Longitude, Latitude: AnsiString;
      const Address, CityName: WideString; CityCode, UserID, ObjectID, Cost: Integer;
      LocType: TLbmpLocType; Param: Pointer; Callback: TSimpleCallback);
      
    procedure SetAutoLocTime(UserID, Hour: Integer; Param: Pointer;
      Callback: TSimpleCallback);
    
    procedure GetLocTrace(ID: Integer; Tracing: TLocTrace;
      Param: Pointer; Callback: TSimpleCallback);
    
    procedure AddLocTrace(Tracing: TLocTrace; Param: Pointer;
      Callback: TSimpleCallback);
    
    procedure RemoveLocTrace(ID: Integer; Param: Pointer;
      Callback: TSimpleCallback);

    procedure ModifyLocTrace(Tracing: TLocTrace; Param: Pointer;
      Callback: TSimpleCallback);
    
    procedure ModifyLBMPState(const Phone: AnsiString; State: Integer;
      Param: Pointer; Callback: TSimpleCallback);
  end;

implementation

end.
